<template>
  <div class="video">
    <!-- 默认视频 -->
    <!-- <section class="default" v-if="!datas.list[0].src">
      <van-icon name="tv-o" size="150px" />
    </section> -->
    <!-- 选择视频后 -->
    <section style="position: relative">
      <video :src="datas.list[0].src" controls :autoplay="datas.autoplay" :poster="datas.list[0].image"></video>
    </section>

    <!-- 删除组件 -->
    <slot name="deles" />
  </div>
</template>
<script lang="ts" setup name="Video">
import { toRefs } from "vue";
const props = defineProps({
  datas: {
    type: Object
  }
});
const { datas } = toRefs(props);
</script>

<style scoped lang="scss">
.video {
  position: relative;

  /* 默认视频 */
  .default {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 210px;
    background: #979797;
  }

  /* 播放图标 */
  .bof {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 100px;
    color: #999999;
    opacity: 0.5;
    transform: translate(-50%, -50%);
  }
  video {
    width: 100%;
  }
}
</style>
